Computing devices often utilize a graphics processing unit (GPU) to accelerate the rendering of graphics data for display. Such computing devices may include, e.g., computer workstations, mobile phones (e.g., so-called smartphones), embedded systems, personal computers, tablet computers, and video game consoles. Rendering generally refers to the process of converting a three-dimensional (3D) graphics scene, which may include one or more 3D graphics objects, into two-dimensional (2D) rasterized image data. A graphics scene may be rendered as a sequence of one or more frames where each frame depicts the graphics scene at a particular instance in time.
A GPU may include a 3D rendering pipeline to provide at least partial hardware acceleration for the rendering of a 3D graphics scene. The 3D graphics objects in a scene may be subdivided by a graphics application into one or more 3D graphics primitives (e.g., points, lines, triangles, patches, etc.), and the GPU may convert the 3D graphics primitives of the scene into 2D rasterized image data for each of the frames to be rendered. Therefore, in the specific context of GPU rendering, rendering may refer to the process of converting 3D graphics primitives that correspond to 3D objects in a graphics scene into 2D rasterized image data.
To render the 3D graphics primitives for a particular frame, a graphics application executing on a host central processing unit (CPU) may place geometry data corresponding to the primitives to be rendered into a GPU-accessible memory, place one or more GPU state set-up commands into the command stream, and place one or more draw calls into the command stream that cause the GPU to render the primitives based on the geometry data. The GPU may process the commands contained in the command stream in the order in which the commands were placed in the command stream, thereby rendering the scene.
With tile-based rendering, a query result is output on per tile basis by the GPU and later accumulated by the CPU. Query results may include, for example, the results from an occlusion query, timestamp query, pipeline status query (pipeline stats), etc. An occlusion query is a query in graphics processing that determines if an object to be rendered is occluded by other objects in a graphical scene (or tile) or not. Accordingly, a query result from such a query is data providing an indication if an object to be rendered is occluded by other objects in a graphical scene (or tile) or not.
In some examples, a timestamp is a sequence of characters or encoded information identifying when a certain event occurred. The timestamp may provide, for example, a date and time that an event occurred. The timestamp may be accurate to a small fraction of a second. A timestamp query may be used to check the timing of certain events in a graphical scene, e.g., by comparing time stamps from a start to a stop of such a query. Accordingly, a query result from such a query may be the difference of time stamps from a start to a stop of such a query.
A pipeline status query or pipeline stats query may be used to check various statistics and status information of a graphics pipeline. Accordingly, a query result from such a query may be data related to various statistics and status information of a graphics pipeline.
The amount of memory needed to store this intermediate per-tile results increases linearly with an increase in the number of tiles. In addition, when a query result is requested, the CPU or other processor may need to accumulate the result in n memory locations to come up with a final value, where “n” is the number of tiles used to render the scene. An increase in the number of tiles also increases the amount of time taken by the CPU to do the accumulation. A more memory and time efficient way to perform such queries may be advantageous.